package org.shopen.ai.puremvc.view.project
{
	import org.puremvc.as3.patterns.mediator.Mediator;
	import org.shopen.ai.puremvc.ApplicationConstants;
	import org.shopen.ai.puremvc.view.domain.cities.CountryMapMediator;
	import org.shopen.ai.puremvc.view.project.components.ProjectPreView;

	public class ProjectPreViewMediator extends Mediator
	{
		public static const NAME : String  = "ProjectPreviewMediator";
		
		protected function get projectPreview() : ProjectPreView
		{
			var result : ProjectPreView = viewComponent as ProjectPreView;
			return result;
		}
		
		public function ProjectPreViewMediator(viewComponent:Object=null)
		{
			super(ProjectPreViewMediator.NAME, viewComponent);
		}
		
		override public function getMediatorName():String
		{
			return ProjectPreViewMediator.NAME;
		}
		
		override public function onRegister():void
		{
			var id : String = ".previewMap";
			facade.registerMediator(new CountryMapMediator(id, projectPreview.countryMap));
			sendNotification(ApplicationConstants.LOAD_COUNTRY_GRAPH, null, id);
		}
	}
}